home *** CD-ROM | disk | FTP | other *** search
/ Softwarová Záchrana 3 / Softwarova-zachrana-3.bin / Xteq X-Setup / xqdcXSP-Setup-EN.exe / {app} / plugins / XQ WinME Clear TEMP folder.xpl < prev    next >
Text File  |  2001-09-01  |  3KB  |  104 lines

  1. "FILE"="Xteq Systems X-Setup Plugin 6.0"
  2. "TYPE"="5"
  3. "COUNT"="4"
  4. "UIPATH 1"="System\File System\Folders\Temporary"
  5. "NAME"="Clear Windows ME TEMP Folder"
  6. "VERSION"="1.56"
  7. "OSVERSION"="00001"
  8. "WARNING"="1"
  9. "LANGUAGE"="VBScript"
  10. "TEXT 1"="Clear TEMP Folder"
  11. "TEXT 2"="Clear TEMP Folder (Security Wipe!)"
  12. "TEXT 3"="Clear TMP Folder"
  13. "TEXT 4"="Clear TMP Folder (Security Wipe!)"
  14. "DESCRIPTION 1"="This plug-in will totally erase any files in your TEMP/TMP folder."
  15. "DESCRIPTION 2"="If you apply the second option, every file found (except any subfolders, or a file named index.dat) will be filled with garbage before deleting so even an undelete does not show what was inside the files."
  16. "DESCRIPTION 3"="These options will not work if you have your TEMP folder set in the registry using a variable, such as %USERPROFILE%\Local Settings\Temp [the %userprofile% is the variable.  Anything between two percent signs (example: %anything% ) is a variable].
  17. "DESCRIPTION 4"="To enable these options to work, you must manually specify a TEMP folder (example: C:\Windows\TEMP or C:\TEMP).  There is a plug-in included with X-Setup which will allow you to set a folder path for the TEMP location."
  18. "AUTHOR"="Xteq Systems (CptSiskoX)"
  19. "CONTACTURL"="http://www.xteq.com"
  20. "COPYRIGHT"="Copyright ⌐ Xteq Systems - All Rights Reserved"
  21. "COMMENT 1"=" "
  22. "COMMENT 2"=" "
  23.  
  24. sP="HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SessionManager\Environment\TEMP"
  25. sP2="HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SessionManager\Environment\TMP"
  26.  
  27. Sub Plugin_Initialize 
  28. End Sub
  29.  
  30. Sub Plugin_CheckData(ElementIndex)
  31. End Sub
  32.  
  33. Sub Plugin_Apply(ElementIndex,ElementSubIndex)
  34.  Select Case ElementIndex
  35.    Case 1:
  36.         Call DoWork(false,sP)  
  37.    Case 2:
  38.         Call DoWork(true,sP)
  39.    Case 3:
  40.         Call DoWork(false,sP2)  
  41.    Case 4:
  42.         Call DoWork(true,sP2)
  43.  End Select
  44. End Sub
  45.  
  46.  
  47. Sub DoWork(EraseTotally,RegPath)
  48.     sBasePath=RegReadValue(RegPath)
  49.  
  50.     if folderexists(sBasePath) then
  51.        'okay, now look for any remaing files...
  52.        Call KillDir(sBasePath,EraseTotally,false)
  53.                    
  54.        'done!
  55.        msginformation "TEMP and/or TMP Folder contents have been eliminated!"
  56.     else
  57.        msgerror "Unable to locate folder - nothing done!"
  58.     end if
  59. end Sub
  60.  
  61.  
  62. Sub KillDir(DirName,EraseTotally,KillDirAlso)
  63.  
  64.  iC=FileEnum(DirName & "\*.*")
  65.  
  66.  for i=1 to iC 
  67.      sFile=FileEnumElement(i)
  68.      'index.dat can not be erased, always locked for writing... grr..
  69.      if right(sFile,9)<>"index.dat" then
  70.    
  71.         if EraseTotally then
  72.            lC=TxtOpen(sFile)
  73.  
  74.            'replace contents of file    
  75.            for l=1 to lC 
  76.                Call TxtSetLine(l,"-")
  77.            next
  78.          
  79.            'desktop.ini is special case..
  80.            if right(sFile,11)="desktop.ini" then
  81.               Call FileSetAttribute(sFile,"R-")
  82.               Call FileSetAttribute(sFile,"H-")
  83.               Call FileSetAttribute(sFile,"S-")
  84.            end if
  85.  
  86.           Call TxtSave()
  87.         end if
  88.  
  89.         'now kill the file
  90.         FileDelete(sFile)
  91.      end if               
  92.  
  93.  next 
  94.  
  95.  if KillDirAlso=true then
  96.     FolderDelete(DirName)
  97.  end if
  98. End Sub
  99.  
  100.  
  101. Sub Plugin_Terminate 
  102. End Sub
  103.  
  104.